<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class PaymentWebWallet extends Model
{
    use SoftDeletes; // 启用软删除功能
    protected $table = 'payment_web_wallets';

    protected $fillable = [
        'wallet_address',
        'wallet_type',
        'last_transaction_time',
        'status',
    ];
    protected $dates = [
        'deleted_at', // 添加 deleted_at 字段
    ];
    protected static function boot()
    {
        parent::boot();

        // 在创建时自动设置上次交易时间为当前时间
        static::creating(function ($model) {
            $model->last_transaction_time = now();
        });
    }
}